Home
Ray
Articles
This Old House
Family History
javaScript Examples
Replace the first occurence of a String
var newtext = text.replace("World War II", "the Second World War");
Replace all instances of a String
var newtext = text.replace(/World War II/g, "the Second World War");